using DapperExtensions.Mapper;

namespace Read.Models.Models
{
    /// <summary>
    /// 字段映射
    /// </summary>
    public class LoginLogMapper : ClassMapper<LoginLogModel>
    {
        public LoginLogMapper()
        {
            Table(Tables.LoginLog);
            Map(c => c.Id).Column("Id").Key(KeyType.Identity);
            Map(c => c.UserName).Column("UserName");
            Map(c => c.Time).Column("Time");
            Map(c => c.Ip).Column("Ip");
            Map(c => c.Status).Column("Status");
            Map(c => c.PassWord).Column("PassWord");
            Map(c => c.Info).Column("Info");
        }
    }

    /// <summary>
    /// 登录日志类
    /// </summary>
    public class LoginLogModel
    {
        /// <summary>
        /// 日志Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 登录操作帐号
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 登录操作时间
        /// </summary>
        public int Time { get; set; }

        /// <summary>
        /// 登录操作Ip
        /// </summary>
        public string Ip { get; set; }

        /// <summary>
        /// 状态,1为登录成功，0为登录失败
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 请求的错误密码
        /// </summary>
        public string PassWord { get; set; }

        /// <summary>
        /// 其他说明
        /// </summary>
        public string Info { get; set; }


    }
}